<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

$this->load->helper('html');
?>



<!-- JavaScript -->
<script type="text/javascript" src="<?= base_url() ?>js/wufoo.js"></script>

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />


<div id="container">
    <fieldset class="fieldset">
        <legend class="legend">

		| Form Data Kelas |</legend>

        <div id="contentform" style="border:solid thin #BBBBBB; height:350px; background-color:#F9F9F9; -moz-border-radius: 5px;  padding-top:10px; padding-bottom:0.3px; margin-right:100px; margin-left:100px;">

            <!-- Start value -->
            <?
            //Setting Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
            $value = array(
                'id_kelas' => "",
                'nama_kelas' => "",
                'hari' => "",
                'jam' => "",
                'ruang_kelas' => "",
                'id_ustad' => "",
                'act_form' => "kelas/add/".$this->session->userdata('id_periode').""
            );

            //Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
            if ($status == "edit") {
                $value['id_kelas'] = $id_kelas;
                $value['nama_kelas'] = $nama_kelas;
                $value['hari'] = $hari;
                $value['jam'] = $jam;
                $value['ruang_kelas'] = $ruang_kelas;
                $value['id_ustad'] = $id_ustad;
                $value['act_form'] = "kelas/update/" . $value['id_kelas'];
            }//end if
            ?>
            <?= form_open_multipart($value["act_form"]); ?>
            <!-- End value -->

            <table width="847" border="0" bordercolor="#F0F0F0">
                <tr>
                    <td width="905" height="150">
                        <form id="form1" name="form1" method="post">
                            <div align="center">
                                <table width="850" border="0">
                                    <tr>
                                        <td width="80">Nama Kelas</td>
                                        <td width="208"><input name="nama_kelas" type="text" size="50" value="<?= $value['nama_kelas'] ?>"/></td>
                                        <td><? echo form_error('nama_kelas');?></td>
                                    </tr>
									<tr>
                                        <td width="80">Hari</td>
										<td width="208"><input name="hari" type="text" size="50" value="<?= $value['hari'] ?>"/></td>
                                        <td><? echo form_error('hari');?></td>
                                    </tr>
									<tr>
                                        <td width="80">Jam</td>
										<td width="208"><input name="jam" type="text" size="50" value="<?= $value['jam'] ?>"/></td>
                                        <td><? echo form_error('jam');?></td>
                                    </tr>
                                    <tr>
                                        <td width="80">Ruang Kelas</td>
										<td> <textarea  id="element_2" name="ruang_kelas" ><?= $value['ruang_kelas'] ?></textarea></td>
                                        <td><? echo form_error('ruang_kelas');?></td>
                                    </tr>
									<tr>
                                        <td width="80">Nama Ustad</td>
                                        <td>
										<?
											$options['0'] = "-- Pilih Ustad --";
											foreach ($ustad->result() as $row)
											{
												$options[$row->id_ustad] = $row->nama_ustad;
											}
											echo form_dropdown('id_ustad', $options, $value["id_ustad"], 'class="field select"');
										?>
										</td>
                                        <td><? echo form_error('id_ustad');?></td>
                                    </tr>
                                    <tr>
                                        <td height="28">&nbsp;</td>
                                        <td>
                                            <div align="left">
                                                <input type="submit" name="Submit" value="Simpan" />
												<a href="<?php echo site_url('kelas/index/'.$this->session->userdata('id_periode').'') ?>">
												<input type="button" value="Kembali" />
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </form>        
                        <p align="center">&nbsp;</p></td></tr>
            </table>
        </div>
        <p>&nbsp;</p>
    </fieldset>
</div> 
<p>
    <!--container-->
</p>
<p>&nbsp; </p>
